﻿/* ***********************************************
 * Author		:  kingthy
 * Email		:  kingthy@gmail.com
 * Description	:  UserTrendData
 *
 * ***********************************************/

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace OpenTwitter.SDK.Sina.Objects
{
    /// <summary>
    /// 用户话题的返回数据
    /// </summary>
    public class UserTrendData : ResponseData
    {   
        /// <summary>
        /// 
        /// </summary>
        /// <param name="xml"></param>
        internal UserTrendData(XmlNode xml)
            : base(xml)
        { }

        /// <summary>
        /// 账号资料
        /// </summary>
        public UserTrend[] Trends { get; private set; }
        /// <summary>
        /// 解析XML文档数据
        /// </summary>
        protected override void Parse()
        {
            base.Parse();
            List<UserTrend> trends = new List<UserTrend>();
            var nodes = this.Xml.SelectNodes("trend");
            foreach (XmlNode n in nodes)
            {
                trends.Add(new UserTrend(n));
            }
            this.Trends = trends.ToArray();
        }
    }
}
